package com.rogchen.security.securitydemo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author Rogchen rogchen128@gmail.com
 * @description:
 * @product: IntelliJ IDEA
 * @created Date: 19-11-4 14:45
 **/
@Controller
public class indexController {


    @GetMapping("data")
    @ResponseBody
    public String data(){

        return "data";
    }

    @GetMapping("index")
    public String index(){
        return "index";
    }
    @GetMapping("login")
    public String login(){
        return "login";
    }

    @GetMapping("/login-error")
    public String loginError(Model model) {
        model.addAttribute("error", "账号信息有误！");
        return "login";
    }
}
